package com.blog.cmrpersonalblog.dto.auth.request;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 验证邮箱验证码请求DTO
 */
@Data
public class VerifyEmailCodeRequest {

    /**
     * 邮箱地址
     */
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    /**
     * 验证码
     */
    @NotBlank(message = "验证码不能为空")
    @Size(min = 6, max = 6, message = "验证码必须是6位数字")
    @Pattern(regexp = "^\\d{6}$", message = "验证码必须是6位数字")
    private String verificationCode;

    /**
     * 验证类型（REGISTER-注册验证，RESET_PASSWORD-重置密码，CHANGE_EMAIL-更换邮箱）
     */
    @NotBlank(message = "验证类型不能为空")
    @Pattern(regexp = "^(REGISTER|RESET_PASSWORD|CHANGE_EMAIL)$", 
             message = "验证类型只能是REGISTER、RESET_PASSWORD或CHANGE_EMAIL")
    private String verificationType;
}

